#include <iostream>
#include <stdio.h>
using namespace std;

// CLASS: instance (i.e. object)
// ACESS SPECIFER: private (default), public, protected
// MEMBER: variable or function
// CONSTRUCTOR: using for initialization

// a simple class example >>>>>>>>>>>>>>>>>>>>>>>>>>>>
class Rect{
  private:
    int width, height;

  public:
    void set_values(int, int);
    int area(){ return width*height;}
};

void Rect::set_values(int x, int y){
    width = x;
    height =y;
}// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

// with constructor ----------------------------------
class Rectangle{
  private:
    int width, height;

  public:
    Rectangle(int x, int y){
        width = x;
        height = y; 
    };  // without any return type, not even void
    int area(){ return width*height;}
}; //------------------------------------------------

int main(void){
    // simple instance 
    Rect rect1;
    rect1.set_values(3, 4);
    printf("Area1    is: %d. \n", rect1.area());

    // with constructor
    Rectangle rect2 (5, 6);
    printf("Area2 is: %d. \n", rect2.area());
    return 0;
}